package main

import (
	"com.hejjon/src/ctl"
	"github.com/gin-gonic/gin"
)

func main() {

	router := gin.Default()
	//userCtl := router.Group("/user")
	//{
	//	userCtl.POST("/login", ctl.Login)
	//	userCtl.POST("/logout", ctl.Logout)
	//}
	//blogCtl := router.Group("/blog")
	//{
	//	blogCtl.POST("/save", ctl.SaveBlogs)
	//	blogCtl.GET("/query", ctl.QueryBlog)
	//}

	// http://localhost:8080/v1/test1/login

	V1 := router.Group("v1")

	test1 := V1.Group("test1")
	{
		test1.POST("login", ctl.Login)
		test1.POST("logout", ctl.Logout)
	}

	test2 := V1.Group("/test2")
	{
		test2.POST("save", ctl.SaveBlogs)
		test2.GET("query", ctl.QueryBlog)
	}

	_ = router.Run(":8080")
}
